package sunbao.ido.experimentalField.listener;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;

/**
 * \* User: MeiZhongHao
 * \* Date: 2018-11-13
 * \* Time: 18:05
 * \* Description:
 * \
 */
@Service
public class UserService {

    @Autowired
    ApplicationContext applicationContext;

    /**
     * 用户注册方法
     * @param user
     */
    public void register(UserBean user){
        //发布UserRegisterEvent事件
        applicationContext.publishEvent(new UserRegisterEvent(this,user));
        SmsManager.notifyListeners(new UserRegisterEvent(this,user));
    }


}